#!/bin/bash
raw_dir="../Run/output"
num=1
# 初始循环

dir=${raw_dir}
mkdir -p $dir
for((j=${num};j<=30;j++))
do
    echo 'the '${num}' simulation'
    seeds=$(($RANDOM % 1000000))
    mdcrd='"'${dir}'/md-'${j}'"'
    str_seeds='s|^seed=.*|seed='$seeds'|'
    str_mdcrd='s|^mdcrd=.*|mdcrd='$mdcrd'|'

    sed -i $str_seeds '../Run/md.in';
    sed -i $str_mdcrd '../Run/md.in';

    ./bct.exe ../Run/md.in;  #运行脚本
    ((num++)); #记录自增
done
